package edu.chinasoft.service;

import edu.chinasoft.domain.User;
import edu.chinasoft.mapper.UserMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserServiceImp implements UserService {
    private UserMapper userMapper;
    private Logger logger =LoggerFactory.getLogger(UserServiceImp.class);
    @Override
    public
    void registerUser(User user) {
        userMapper.insertTable(user);
    }

    @Override
    public
    User loginUser(User user) {
        logger.debug("UserServiceImp>>>loginUser start ……");
        User result=userMapper.selectTableByNameAndPassword(user);
        logger.debug("UserServiceImp>>>loginUser end ……");
        return result;
    }

    public
    UserMapper getUserMapper() {
        return userMapper;
    }

    public
    void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }
}
